package com.dcy.znoa.common.util;

/**
 * Created by pengyu on 2018/1/24.
 */
public class StringPy {

    public static String trim(String str) {
        int len = str.length();
        int st = 0;
        int off = 0;
        char[] val = str.toCharArray();

        while ((st < len) && (val[off + st] <= ',')) {
            st++;
        }
        while ((st < len) && (val[off + len - 1] <= ',')) {
            len--;
        }
        return ((st > 0) || (len < str.length())) ? str.substring(st, len)
                : str;
    }
}
